﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace EFCore.Models;

[Table("Box")]
public partial class Box
{
    [Key]
    [Column("Id_Box")]
    public Guid IdBox { get; set; }

    public string BoxCode { get; set; } = null!;

    /// <summary>
    /// 类型
    /// </summary>
    public string? Type { get; set; }

    /// <summary>
    /// 宽
    /// </summary>
    public int Width { get; set; }

    /// <summary>
    /// 深
    /// </summary>
    public int DePth { get; set; }

    /// <summary>
    /// 高
    /// </summary>
    public int Height { get; set; }

    /// <summary>
    /// 格口数
    /// </summary>
    public int BoxGridQuantity { get; set; }

    public DateTime CreateTime { get; set; }

    public DateTime? UpdateTime { get; set; }

    /// <summary>
    /// 允许使用
    /// </summary>
    public bool IsEnable { get; set; }

    /// <summary>
    /// 是否使用虚拟储位
    /// </summary>
    public bool VirtualSpace { get; set; }

    public string? Info { get; set; }

    public string? Remarks { get; set; }

    [Column("Id_WarehouseLine")]
    public Guid? IdWarehouseLine { get; set; }

    [Column("Id_InlethouseLine")]
    public Guid? IdInlethouseLine { get; set; }

    [InverseProperty("TheBoxIdBoxNavigation")]
    public virtual ICollection<BoxGrid> BoxGrids { get; set; } = new List<BoxGrid>();

    [ForeignKey("IdInlethouseLine")]
    [InverseProperty("Boxes")]
    public virtual InlethouseLine? IdInlethouseLineNavigation { get; set; }

    [ForeignKey("IdWarehouseLine")]
    [InverseProperty("Boxes")]
    public virtual WarehouseLine? IdWarehouseLineNavigation { get; set; }

    [InverseProperty("IdBoxNavigation")]
    public virtual ICollection<TaskOrder> TaskOrders { get; set; } = new List<TaskOrder>();
}
